TMPNAM
Section: MINTLIB LIBRARY FUNCTIONS
(3)
Updated: 3 March 1993
Index
Return to Main Contents
NAME
tmpnam - create a name for a temporary file
SYNOPSIS
#include <stdio.h>
char *tmpnam(char *buf);
DESCRIPTION
This function generates a file name that can safely be used
for a temporary file.
tmpnam always tries to generate a file name in a directory
meant for temporary files; it tries to determine such a
directory by checking the environment variables TEMP, TMPDIR,
TMP and TEMPDIR, successively; if this search fails, the
current directory is used.
If buf is NULL, tmpnam leaves its result in an internal
static area and returns a pointer to that area. The next call
to tmpnam will destroy the contents of the area. If buf is
not NULL, it is assumed to be the address of an buffer area;
tmpnam places its result in that buffer and returns buf.
SEE ALSO
creat(3),
fopen(3),
mktemp(3),
tmpfile(3),
unlink(3)
NOTES
The related UN*X function tempnam is currently not available
in the mintlibs.
This function generates a different file name each time it is
called.
Files created using this function and either fopen or creat
are temporarily only in the sense that they reside in a
directory intended for temporary use, and their file names
are unique. It is the user's responsibility to use unlink to
remove the file when its use is ended.
Index
- NAME
-
- SYNOPSIS
-
- DESCRIPTION
-
- SEE ALSO
-
- NOTES
-
This document was created by
man2html,
using the manual pages.
Time: 11:15:06 GMT, June 22, 2025